import os

def register(username : str, password : str) -> tuple[int, str]:
    if not os.path.exists("userInfo"):
        os.mkdir("userInfo")
    
    if len(password) < 6:
        return 3, "password too short" # 3 for password too short

    if os.path.exists("userInfo/" + username + ".txt"):
        return 2, "already exists" # 2 for already exists
    
    with open("userInfo/" + username + ".txt", "w") as f:
        f.write(f"username: {username}\n")
        f.write(f"password: {password}\n")

    return 1, "success" # 1 for success